import { Injectable } from '@nestjs/common';
import { WebsocketGateway } from './websocket/websocket.gateway';

@Injectable()
export class SomeService {
  constructor(private wsGateway: WebsocketGateway) {}

  someMethod() {
    // 广播消息
    this.wsGateway.broadcast({
      type: 'update',
      data: 'Some data'
    });
  }
}